Disable xen bus and grant tables when supervisor_mode_kernel is enabled.
authorIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Fri, 31 Mar 2006 10:04:42 +0000 (11:04 +0100)
committerIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Fri, 31 Mar 2006 10:04:42 +0000 (11:04 +0100)
Neither of these features are useful/available in this mode since only a
single domain is supported.

Do not attempt to initialise xen bus when supervisor_mode_kernel is
enabled.

Do not BUG_ON() failure to setup grant tables, future versions
of supervisor_mode_kernel may return -ENOSYS here.

Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
linux-2.6-xen-sparse/drivers/xen/core/gnttab.c
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c

index 1049934008b6df1843175df5e343f0c6d1670820..fa12e701d4222c46d53d40d762fd743cd0a5792e 100644 (file)
@@ -395,7 +395,10 @@ gnttab_resume(void)
        setup.frame_list = frames;
 
        rc = HYPERVISOR_grant_table_op(GNTTABOP_setup_table, &setup, 1);
-       BUG_ON(rc || setup.status);
+       if (rc < 0)
+               return rc;
+
+       BUG_ON(setup.status);
 
 #ifndef __ia64__
        if (shared == NULL) {
@@ -436,7 +439,8 @@ gnttab_init(void)
        if (xen_init() < 0)
                return -ENODEV;
 
-       BUG_ON(gnttab_resume());
+       if (gnttab_resume() < 0)
+               return -ENODEV;
 
        for (i = NR_RESERVED_ENTRIES; i < NR_GRANT_ENTRIES; i++)
                gnttab_list[i] = i + 1;
index d3f37e636d595d4d52a7982bfaf6864e771dd3d3..935ec0a5eb0f931d291036a35113b9588a0119ee 100644 (file)
@@ -997,6 +997,14 @@ static int __init xenbus_probe_init(void)
        device_register(&xenbus_frontend.dev);
        device_register(&xenbus_backend.dev);
 
+       /*
+         * The supervisor_mode_kernel feature only allows a single
+         * domain so there is no need to initialise event channels
+         * etc.
+         */
+       if (xen_feature(XENFEAT_supervisor_mode_kernel))
+               return -ENODEV;
+
        /*
         * Domain0 doesn't have a store_evtchn or store_mfn yet.
         */